package com.situ.pattern.factory;

import org.junit.jupiter.api.Test;

public class Demo {
    //Client
    public static void main(String[] args) {
        AbstractCal cal = new Add(3, 5);
        System.out.println(cal.getResult());
        cal = new Sub(45, 6);
        System.out.println(cal.getResult());
    }

    @Test
    public void test1() {
        AbstractCal cal = CalFactory.createCal(2);
        cal.setNum1(3);
        cal.setNum2(5);
        System.out.println(cal.getResult());
    }
}
